

function test_path(test_path , osname)
    if test_path and os.isdir(test_path) then
        local result = {}
        result.includedirs = {path.join(test_path , "include") , path.join(test_path , "include" , osname)}
        result.linkdirs = {path.join(test_path, "lib") , path.join(test_path, "lib" , "server") }
        result.links = {"jvm", "jawt"}
        return result
    end
    return false
end


function main(package, opt)
    local cfg_path = package:config("JAVA_HOME")
    local osname
    if get_config('target_os') == "linux" or is_plat("linux") then
        osname = "linux"
    elseif  is_plat("windows") then
        osname = "windows"
    end

    local ret
    ret = test_path(cfg_path , osname)
    if ret then 
        return ret
    end
end

